package cn.shiva;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shiva   2022-07-21 13:33
 */
@RestController
@RequestMapping(value = "/consumer")
public class ConsumerController {

    @DubboReference(group = "provider", version = "1.0", loadbalance = "roundrobin")
    private IProviderService providerService;
//    @DubboReference(group = "provider2", version = "1.1")
//    private IProviderService provider2Service;

    @RequestMapping("/index")
    public String index() {
//        System.out.println(providerService.getMessageById("111"));
//        System.out.println(provider2Service.getMessageById("222"));
        return providerService.getMessageById("111");
    }
}
